home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / May 90 / MacApp.Tech$ 5⁄25⁄90 / 1323-Re External Objects -May90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  35 lines  |  [TEXT/GEOL]

  1. Item    3055273                         21-May-90        13:44PDT
  2.  
  3. From:   DEREK                           White, Derek
  4.  
  5. To:     UK0320                          Desktop Communications Ltd,IDV
  6.         MACAPP.TECH$                    MacApp Technical
  7.  
  8. Sub:    Re-External Objects in Pascal
  9.  
  10. Paul,
  11.  
  12.   The way I remember it, forward or external object type references can be used
  13. as a field type (and some other places), because all the compiler needs to know
  14. (at the declaration point) is how much space to allocate for the field, and all
  15. object references are 4 bytes.  Inheriting from an object-types requires that
  16. the compiler know all about the ancestor, so you can't inherit from a forward
  17. or external object type.
  18.  
  19.     I think you're kind of stuck for now.  In a future version of the compiler,
  20. you might be able to have a USES clause in the IMPLEMENTATION section of a
  21. unit, so in your example, unitB wouldn't use unitA in it's interface, but it
  22. would in it's implementation, so when unitA gets read in, ObjB is fully
  23. defined.
  24.  
  25.     For now I suggest that the fObjA field in TObjB be of type TObjB (instead
  26. of TObjA).  Thsi would eliminate the need for the mutual uses for this example.
  27. Since TObjA is a descendant of TObjB, this should work in all cases except when
  28. you want to call a TObjA method on fObjA.  Then you would need to do a (gross
  29. looking) type coercion.
  30.  
  31. Gook Luck,
  32. - Derek White
  33. - ATG East/Columbia
  34.  
  35.